package com.iflytek.autofly.setting.util;

import android.graphics.LinearGradient;
import android.graphics.Shader;
import android.graphics.Shader.TileMode;

/**
 * @author yutian2 提供渐变色
 */
public class RenderUtil {

    public static Shader getShader() {
        Shader shader = new LinearGradient(0, 0, 0, 27, 0xffffffff, 0xffccccff,
                TileMode.MIRROR);
        return shader;
    }

    /**
     * @param startColor 起始渐变色 十六进制 如 0xffffffff
     * @param endColor   结束渐变色 十六进制 如 0xffccccff
     * @return
     */
    public static Shader getShaderByColor(int startColor, int endColor) {
        Shader shader = new LinearGradient(0, 0, 0, 27, startColor, endColor,
                TileMode.MIRROR);
        return shader;
    }

}
